<?php
class LinkWidget extends CWidget
{

	public $htmlOptions = array();

	public $length = 20;
	public $limit = 20;
	public $id;
	
	public function getData()
	{
		$model = Links::model()->findAll(array(
			'condition'=>'link_status = :link_status',
			'order'=>'link_order DESC',
			'limit'=>$this->limit,
			'params'=>array(
				':link_status'=>Links::LINK_STATUS_ALLOW
			)
		));
		return $model;
	}
	
	public function run()
	{	
		$this->render('link',array(
			'list'=>$this->getData()
		));
	}
}
?>